package com.itheima.demo03functionalinterface;

import java.util.function.Predicate;

/**
 * @author chenming
 * Date  2023/6/14 9:13
 * @version 1.0
 * description
 */
public class Demo07Predicate {
    // 使用Lambda判断一个人名如果超过3个字就认为是很长的名字
    public static void main(String[] args) {
        isLongName(name->{
            return name.length() > 3;
        });
        float a = 33.33f;
        a = (float) (int)a;
        System.out.println(a);
    }

    private static void isLongName(Predicate<String> predicate) {
        boolean isLong = predicate.test("迪丽热巴");
        System.out.println("是否是长名字: " + isLong);
    }


}
